import './Header.css'
import React,{useState} from 'react';
import {v4 as uuidv4} from 'uuid'
function Headers(props){
  
  function getter_(e){
    if(e.keyCode===13 && e.target.value !=''){
      props.addTodo(e.target.value);
      e.target.value=''
    }  
  }
  return (
    <header>
      <section>
        <h1>ToDoList</h1>
        <div className='input'>
          <input className='inputinner' onKeyDown={(e)=>getter_(e)}  type="text" placeholder='请输入待办事项' />
        </div>
      </section>
    </header>
  )
}
export default Headers;